3. Echopype demonstration notebook 2

3.1. Watching a solar eclipse using a moored echosounder

Jupyter notebook accompanying the manuscript:

Echopype: A Python library for interoperable and scalable processing of ocean sonar data for biological information
Authors: Wu-Jung Lee, Emilio Mayorga, Landung Setiawan, Kavin Nguyen, Imran Majeed, Valentina Staneva

3.1.1. Goals

  • Illustrate a common workflow for echosounder data conversion, calibration and use. This workflow leverages the standardization applied by echopype. and the power, ease of use and familiarity of libraries in the scientific Python ecosystem.

  • Demonstrate the ease to interoperate echosounder data with those from a different instrument in a single computing environment. Without echopype, additional wrangling across more than one software systems is needed to achieve the same visualization and comparison.

3.1.2. Description

This notebook uses EK60 echosounder data from the U.S. Ocean Observatories Initiative (OOI) to illustrate a common workflow for data conversion, combination, calibration and analysis using echopype, as well as the data interoperability it enables. Without echopype, additional wrangling across more than one software systems is needed to achieve the same visualization and comparison.

We will use data from the OOI Oregon Offshore Cabled Shallow Profiler Mooring collected on August 20-21, 2017. This was the day before and of a solar eclipse, during which the reduced sunlight affected the regular diel vertical migration (DVM) patterns of marine life. This change was directly observed using the upward-looking echosounder mounted on this mooring platform that happened to be within the totality zone. The effect of the solar eclipse was clearly seen by aligning and comparing the echosounder observations with solar radiation data collected by the Bulk Meteorology Instrument Package located on the nearby Coastal Endurance Oregon Offshore Surface Mooring, also maintained by the OOI.

The data used are 15 .raw files with a total volume of approximately 1 GB. With echopype functionality, the raw data files hosted on the OOI Raw Data Archive (an HTTP server) are directly parsed and organized into a standardized representation following in the SONAR-netCDF4 v1.0 convention, and stored to the cloud-optimized Zarr format. The inidividual converted files are later combined into a single entity that can be easily explored and manipulated.

3.1.3. Outline

  1. Establish connection with the OOI Raw Data Archive and generate list of target EK60 .raw files

  2. Process the archived raw files with echopype: convert and combine into a single quantity (an EchoData object) in a standardized format.

  3. Obtain solar radiation data from an OOI Thredds server.

  4. Plot the echosounder and solar radiation data together to visualize the zooplankton response to a solar eclipse.

3.1.4. Running the notebook

This notebook can be run with a conda environment created using the conda environment file https://github.com/OSOceanAcoustics/echopype-examples/blob/echopype_paper/binder/environment.yml. The notebook creates a directory ./exports/ooifiles and save all generated Zarr and netCDF files there.

3.1.5. Warning

The combine_echodata step in this notebook may result in kernel dying on Binder or an older computer. We are actively working on improving memory handling especially on distributed systems.

3.1.6. Note

We encourage importing echopype as ep for consistency.

from pathlib import Path
import itertools as it
import datetime as dt
from dateutil import parser as dtparser

import fsspec
import xarray as xr
import matplotlib.pyplot as plt
import hvplot.xarray

import echopype as ep

import warnings
warnings.simplefilter("ignore", category=DeprecationWarning)

3.2. Establish connection with the OOI Raw Data Archive and generate list of target EK60 .raw files

Access and inspect the publicly accessible OOI Raw Data Archive (an HTTP server) as if it were a local file system. This will be done through the Python fsspec file system and bytes storage interface. We will use fsspec.filesystem.glob (fs.glob) to generate a list of all EK60 .raw data files in the archive then filter on file names for target dates of interest.

fs = fsspec.filesystem('https')
ooi_raw_url = (
    "https://rawdata.oceanobservatories.org/files/"
    "CE04OSPS/PC01B/ZPLSCB102_10.33.10.143/2017/08"
)

Now let’s specify the range of dates we will be pulling data from. Note that the data filenames contain the time information but were recorded at UTC time.

def in_range(raw_file: str, start: dt.datetime, end: dt.datetime) -> bool:
    """Check if file url is in datetime range"""
    file_name = Path(raw_file).name
    # file_name = os.path.basename(raw_file)
    file_datetime = dtparser.parse(file_name, fuzzy=True)
    return file_datetime >= start and file_datetime <= end
start_datetime = dt.datetime(2017, 8, 21, 7, 0)
end_datetime = dt.datetime(2017, 8, 22, 7, 0)

On the OOI Raw Data Archive, the monthly folder is further split to daily folders, so we can simply grab data from the desired days.

desired_day_urls = [f"{ooi_raw_url}/{day}" for day in range(start_datetime.day, end_datetime.day + 1)]
desired_day_urls
['https://rawdata.oceanobservatories.org/files/CE04OSPS/PC01B/ZPLSCB102_10.33.10.143/2017/08/21',
 'https://rawdata.oceanobservatories.org/files/CE04OSPS/PC01B/ZPLSCB102_10.33.10.143/2017/08/22']

Grab all raw files within daily folders by using the filesytem glob, just like the Linux glob.

all_raw_file_urls = it.chain.from_iterable([fs.glob(f"{day_url}/*.raw") for day_url in desired_day_urls])
dt.timedelta(hours=3)
datetime.timedelta(seconds=10800)
desired_raw_file_urls = list(filter(
    lambda raw_file: in_range(
        raw_file, 
        start_datetime-dt.timedelta(hours=3),  # 3 hour buffer to select files
        end_datetime+dt.timedelta(hours=3)
    ), 
    all_raw_file_urls
))


print(f"There are {len(desired_raw_file_urls)} raw files within the specified datetime range.")
There are 19 raw files within the specified datetime range.

3.3. Process the archived raw files with echopype

3.3.1. Examine the workflow by processing just one file

Let’s first test the echopype workflow by converting and processing 1 file from the above list.

We will use ep.open_raw to directly read in a raw data file from the OOI HTTP server.

The type of sonar needs to be specified as an input argument. The echosounders on the OOI Regional Cabled Array are Simrad EK60 echosounder. All other uncabled echosounders are the Acoustic Zooplankton and Fisher Profiler (AZFP) manufacturered by ASL Environmental Sciences. Echopype supports both of these and other instruments (see echopype documentation for detail).

3.3.2. Converting from raw data files to a standardized data format

Below we already know the path to the 1 file on the http server:

echodata = ep.open_raw(raw_file=desired_raw_file_urls[0], sonar_model="ek60")
20:02:46  parsing file OOI-D20170821-T045717.raw, time of first ping: 2017-Aug-21 04:57:17

Here echopype read, parse, and convert content of the raw file into memory, and gives you a nice representation of the converted file below as a Python EchoData object.

echodata
EchoData: standardized raw data from Internal Memory
    • <xarray.Dataset>
      Dimensions:  ()
      Data variables:
          *empty*
      Attributes:
          conventions:                 CF-1.7, SONAR-netCDF4-1.0, ACDD-1.3
          keywords:                    EK60
          sonar_convention_authority:  ICES
          sonar_convention_name:       SONAR-netCDF4
          sonar_convention_version:    1.0
          summary:                     
          title:                       
          date_created:                2017-08-21T04:57:17Z
          survey_name:                 

    • <xarray.Dataset>
      Dimensions:                 (frequency: 3, ping_time: 5923)
      Coordinates:
        * frequency               (frequency) float64 3.8e+04 1.2e+05 2e+05
        * ping_time               (ping_time) datetime64[ns] 2017-08-21T04:57:17.32...
      Data variables:
          absorption_indicative   (frequency, ping_time) float64 0.009785 ... 0.05269
          sound_speed_indicative  (frequency, ping_time) float64 1.494e+03 ... 1.49...

    • <xarray.Dataset>
      Dimensions:        (location_time: 1, frequency: 3, ping_time: 5923)
      Coordinates:
        * location_time  (location_time) datetime64[ns] NaT
        * frequency      (frequency) float64 3.8e+04 1.2e+05 2e+05
        * ping_time      (ping_time) datetime64[ns] 2017-08-21T04:57:17.328999936 ....
      Data variables:
          latitude       (location_time) float64 dask.array<chunksize=(1,), meta=np.ndarray>
          longitude      (location_time) float64 dask.array<chunksize=(1,), meta=np.ndarray>
          sentence_type  (location_time) float64 dask.array<chunksize=(1,), meta=np.ndarray>
          pitch          (frequency, ping_time) float64 dask.array<chunksize=(3, 2500), meta=np.ndarray>
          roll           (frequency, ping_time) float64 dask.array<chunksize=(3, 2500), meta=np.ndarray>
          heave          (frequency, ping_time) float64 dask.array<chunksize=(3, 2500), meta=np.ndarray>
          water_level    (frequency, ping_time) float64 dask.array<chunksize=(3, 2500), meta=np.ndarray>

    • <xarray.Dataset>
      Dimensions:        (location_time: 1)
      Coordinates:
        * location_time  (location_time) datetime64[ns] 2017-08-21T04:57:17.328999936
      Data variables:
          NMEA_datagram  (location_time) <U22 '$SDVLW,0.000,N,0.000,N'
      Attributes:
          description:  All NMEA sensor datagrams

    • <xarray.Dataset>
      Dimensions:  ()
      Data variables:
          *empty*
      Attributes:
          conversion_software_name:     echopype
          conversion_software_version:  0.5.4
          conversion_time:              2021-10-28T03:02:50Z
          src_filenames:                https://rawdata.oceanobservatories.org/file...
          duplicate_ping_times:         0

    • <xarray.Dataset>
      Dimensions:  ()
      Data variables:
          *empty*
      Attributes:
          sonar_manufacturer:      Simrad
          sonar_model:             ER60
          sonar_serial_number:     
          sonar_software_name:     
          sonar_software_version:  2.4.3
          sonar_type:              echosounder

    • <xarray.Dataset>
      Dimensions:                         (frequency: 3, ping_time: 5923, range_bin: 1072)
      Coordinates:
        * frequency                       (frequency) float64 3.8e+04 1.2e+05 2e+05
        * ping_time                       (ping_time) datetime64[ns] 2017-08-21T04:...
        * range_bin                       (range_bin) int64 0 1 2 3 ... 1069 1070 1071
      Data variables: (12/30)
          channel_id                      (frequency) <U39 'GPT  38 kHz 00907208dd1...
          beam_type                       (frequency) int64 0 1 0
          beamwidth_receive_alongship     (frequency) float64 7.1 7.0 7.0
          beamwidth_receive_athwartship   (frequency) float64 7.1 7.0 7.0
          beamwidth_transmit_alongship    (frequency) float64 7.1 7.0 7.0
          beamwidth_transmit_athwartship  (frequency) float64 7.1 7.0 7.0
          ...                              ...
          data_type                       (frequency, ping_time) float64 1.0 ... 1.0
          count                           (frequency, ping_time) float64 1.072e+03 ...
          offset                          (frequency, ping_time) float64 0.0 ... 0.0
          transmit_mode                   (frequency, ping_time) float64 0.0 ... 0.0
          angle_athwartship               (frequency, ping_time, range_bin) float64 ...
          angle_alongship                 (frequency, ping_time, range_bin) float64 ...
      Attributes:
          beam_mode:              vertical
          conversion_equation_t:  type_3

    • <xarray.Dataset>
      Dimensions:           (frequency: 3, pulse_length_bin: 5)
      Coordinates:
        * frequency         (frequency) float64 1.2e+05 3.8e+04 2e+05
        * pulse_length_bin  (pulse_length_bin) int64 0 1 2 3 4
      Data variables:
          sa_correction     (frequency, pulse_length_bin) float64 0.0 0.0 ... 0.0 0.0
          gain_correction   (frequency, pulse_length_bin) float64 23.5 24.8 ... 25.0
          pulse_length      (frequency, pulse_length_bin) float64 6.4e-05 ... 0.001024

The EchoData object can be saved to either the netCDF4 or zarr formats through to_netcdf or to_zarr methods.

# Create directories for files genereated in this notebook.
base_dpath = Path('./exports')
base_dpath.mkdir(exist_ok=True)

output_dpath = Path(base_dpath / 'ooimooring_onefiletest')
output_dpath.mkdir(exist_ok=True)
# Save to netCDF format
echodata.to_netcdf(save_path=output_dpath, overwrite=True)
20:02:52  overwriting exports/ooimooring_onefiletest/OOI-D20170821-T045717.nc
# Save to zarrr format
echodata.to_zarr(save_path=output_dpath, overwrite=True)
20:03:00  overwriting exports/ooimooring_onefiletest/OOI-D20170821-T045717.zarr

3.3.3. Basic echo processing

At present echopype supports basic processing funcionalities including calibration (from raw instrument data records to volume backscattering strength, \(S_V\)), denoising, and computing mean volume backscattering strength, \(\overline{S_V}\) or \(\text{MVBS}\). The Echodata object can be passed into various calibrate and preprocessing functions without having to write out any intermediate files.

Here we demonstrate calibration to obtain \(S_V\). For EK60 data, by default the function uses environmental (sound speed and absorption) and calibration parameters stored in the data file. Users can optionally specify other parameter choices.

# Compute volume backscattering strength (Sv) from raw data
ds_Sv = ep.calibrate.compute_Sv(echodata)

The computed Sv is stored with other variables used in the calibration operation.

ds_Sv
<xarray.Dataset>
Dimensions:                (frequency: 3, ping_time: 5923, range_bin: 1072)
Coordinates:
  * frequency              (frequency) float64 3.8e+04 1.2e+05 2e+05
  * ping_time              (ping_time) datetime64[ns] 2017-08-21T04:57:17.328...
  * range_bin              (range_bin) int64 0 1 2 3 4 ... 1068 1069 1070 1071
Data variables:
    Sv                     (frequency, ping_time, range_bin) float64 3.839 .....
    range                  (frequency, ping_time, range_bin) float64 0.0 ... ...
    temperature            object None
    salinity               object None
    pressure               object None
    sound_speed            (frequency, ping_time) float64 1.494e+03 ... 1.494...
    sound_absorption       (frequency, ping_time) float64 0.009785 ... 0.05269
    sa_correction          (frequency) float64 0.0 0.0 0.0
    gain_correction        (frequency) float64 26.5 25.0 25.0
    equivalent_beam_angle  (frequency) float64 -20.6 -20.7 -20.7

3.3.4. Quickly visualize the result

The default xarray visualization functions are useful in getting a quick sense of the data.

ds_Sv.Sv.sel(frequency=200000).plot.pcolormesh(
    x='ping_time', cmap = 'jet', vmin=-80, vmax=-30)
<matplotlib.collections.QuadMesh at 0x161440f40>
_images/ms_OOI_EK60_mooringtimeseries_33_1.png

Note that the vertical axis is range_bin. This is the bin (or sample) number as recorded in the data. A separate data variable in ds_Sv contains the physical range from the transducer in meters. range has the same dimension as Sv and may not be uniform across all frequency channels or pings, depending on the echosounder setting during data collection.

3.3.5. Convert multiple files and combine into a single EchoData object

Now that we verified that echopype does work for a single file, let’s proceed to process all sonar data from August 20-21, 2017.

First, convert all desired files from the OOI HTTP server to a local directory ./exports/ooimooring_allfiles.

# Create a directory for all files
output_dpath = Path(base_dpath / 'ooimooring_allfiles')
output_dpath.mkdir(exist_ok=True)
%%time
for raw_file_url in desired_raw_file_urls:
    # Read and convert, resulting in echodata object
    ed = ep.open_raw(raw_file=raw_file_url, sonar_model='ek60')
    ed.to_zarr(save_path=output_dpath, overwrite=True)
20:03:07  parsing file OOI-D20170821-T045717.raw, time of first ping: 2017-Aug-21 04:57:17
20:03:13  overwriting exports/ooimooring_allfiles/OOI-D20170821-T045717.zarr
20:03:15  parsing file OOI-D20170821-T063618.raw, time of first ping: 2017-Aug-21 06:36:18
20:03:21  overwriting exports/ooimooring_allfiles/OOI-D20170821-T063618.zarr
20:03:24  parsing file OOI-D20170821-T081522.raw, time of first ping: 2017-Aug-21 08:15:22
20:03:35  overwriting exports/ooimooring_allfiles/OOI-D20170821-T081522.zarr
20:03:37  parsing file OOI-D20170821-T095435.raw, time of first ping: 2017-Aug-21 09:54:35
20:03:46  overwriting exports/ooimooring_allfiles/OOI-D20170821-T095435.zarr
20:03:48  parsing file OOI-D20170821-T113343.raw, time of first ping: 2017-Aug-21 11:33:43
20:03:54  overwriting exports/ooimooring_allfiles/OOI-D20170821-T113343.zarr
20:03:56  parsing file OOI-D20170821-T131245.raw, time of first ping: 2017-Aug-21 13:12:45
20:04:03  overwriting exports/ooimooring_allfiles/OOI-D20170821-T131245.zarr
20:04:05  parsing file OOI-D20170821-T145147.raw, time of first ping: 2017-Aug-21 14:51:47
20:04:11  overwriting exports/ooimooring_allfiles/OOI-D20170821-T145147.zarr
20:04:13  parsing file OOI-D20170821-T163049.raw, time of first ping: 2017-Aug-21 16:30:49
20:04:19  overwriting exports/ooimooring_allfiles/OOI-D20170821-T163049.zarr
20:04:22  parsing file OOI-D20170821-T180952.raw, time of first ping: 2017-Aug-21 18:09:52
20:04:30  overwriting exports/ooimooring_allfiles/OOI-D20170821-T180952.zarr
20:04:32  parsing file OOI-D20170821-T194853.raw, time of first ping: 2017-Aug-21 19:48:53
20:04:38  overwriting exports/ooimooring_allfiles/OOI-D20170821-T194853.zarr
20:04:40  parsing file OOI-D20170821-T212802.raw, time of first ping: 2017-Aug-21 21:28:02
20:04:46  overwriting exports/ooimooring_allfiles/OOI-D20170821-T212802.zarr
20:04:48  parsing file OOI-D20170821-T230706.raw, time of first ping: 2017-Aug-21 23:07:06
20:04:51  overwriting exports/ooimooring_allfiles/OOI-D20170821-T230706.zarr
20:04:54  parsing file OOI-D20170822-T000000.raw, time of first ping: 2017-Aug-22 00:00:00
20:05:02  overwriting exports/ooimooring_allfiles/OOI-D20170822-T000000.zarr
20:05:06  parsing file OOI-D20170822-T013902.raw, time of first ping: 2017-Aug-22 01:39:02
20:05:14  overwriting exports/ooimooring_allfiles/OOI-D20170822-T013902.zarr
20:05:17  parsing file OOI-D20170822-T031804.raw, time of first ping: 2017-Aug-22 03:18:04
20:05:24  overwriting exports/ooimooring_allfiles/OOI-D20170822-T031804.zarr
20:05:27  parsing file OOI-D20170822-T045705.raw, time of first ping: 2017-Aug-22 04:57:05
20:05:32  overwriting exports/ooimooring_allfiles/OOI-D20170822-T045705.zarr
20:05:34  parsing file OOI-D20170822-T063606.raw, time of first ping: 2017-Aug-22 06:36:06
20:05:40  overwriting exports/ooimooring_allfiles/OOI-D20170822-T063606.zarr
20:05:42  parsing file OOI-D20170822-T081508.raw, time of first ping: 2017-Aug-22 08:15:08
20:05:48  overwriting exports/ooimooring_allfiles/OOI-D20170822-T081508.zarr
20:05:51  parsing file OOI-D20170822-T095414.raw, time of first ping: 2017-Aug-22 09:54:14
20:05:57  overwriting exports/ooimooring_allfiles/OOI-D20170822-T095414.zarr
CPU times: user 1min 18s, sys: 24.4 s, total: 1min 43s
Wall time: 2min 53s

Then, assemble a list of EchoData object from the converted files. Note that be default the files are lazy-loaded and only metadata are read into memory, until more operations are executed.

# Use fsspec locally to assemble a list of converted files
fs_local = fsspec.filesystem('file')
ed_list = []
for converted_file in fs_local.glob(output_dpath / f"*.zarr"):
    ed_list.append(ep.open_converted(converted_file))

Combine all the opened files to a single EchoData object in memory. This will take a bit of time to execute.

ed = ep.combine_echodata(ed_list)

3.3.6. Calibrate the combined EchoData and visualize the mean Sv

The single EchoData object is convenient to use for content inspection and calibration.

ds_Sv = ep.calibrate.compute_Sv(ed)

Next, compute the mean Sv (MVBS) with coherent dimensions along physically meaning range (in meters) and ping_time from the calibrated data. This processed dataset is easy to visualize. The average bin size along ping_time can be specified using the offset alias.

ds_MVBS = ep.preprocess.compute_MVBS(
    ds_Sv, 
    range_meter_bin=0.2,  # 0.2 meters
    ping_time_bin='10S'   # 10 seconds
)

The resulting MVBS Dataset has a coherent range coorindate across all frequencies.

ds_MVBS
<xarray.Dataset>
Dimensions:    (ping_time: 11017, frequency: 3, range: 1023)
Coordinates:
  * ping_time  (ping_time) datetime64[ns] 2017-08-21T04:57:10 ... 2017-08-22T...
  * frequency  (frequency) float64 3.8e+04 1.2e+05 2e+05
  * range      (range) float64 0.0 0.2 0.4 0.6 0.8 ... 203.8 204.0 204.2 204.4
Data variables:
    Sv         (frequency, ping_time, range) float64 10.29 2.976 ... -53.92
Attributes:
    binning_mode:          physical units
    range_meter_interval:  0.2m
    ping_time_interval:    10S

3.3.7. Visualize MVBS interactively using hvPlot

To visualize, invert the range axis since the echosounder is upward-looking from a platform at approximately 200 m water depth.

ds_MVBS = ds_MVBS.assign_coords(depth=("range", ds_MVBS["range"].values[::-1]))
ds_MVBS = ds_MVBS.swap_dims({'range': 'depth'})  # set depth as data dimension
ds_MVBS["Sv"].sel(frequency=200000).hvplot.image(
    x='ping_time', y='depth', 
    color='Sv', rasterize=True, 
    cmap='jet', clim=(-80, -30),
    xlabel='Time (UTC)',
    ylabel='Depth (m)'
).options(width=800, invert_yaxis=True)
OMP: Info #271: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead.

Note that the reflection from the sea surface shows up at a location below the depth of 0 m. This is because we have not corrected for the actual depth of the platform on which the echosounder is mounted, and the actual sound speed at the time of data collection (which is related to the calculated range) could also be different from the user-defined sound speed stored in the data file. More accurate platform depth information can be obtained using data from the CTD collocated on the moored platform.

3.4. Obtain solar radiation data from an OOI Thredds server

Now we have the sonar data ready, the next step is to pull solar radiation data collected by a nearby surface mooring also maintained by the OOI. The Bulk Meteorology Instrument Package is located on the Coastal Endurance Oregon Offshore Surface Mooring.

Note: an earlier version of this notebook used the same dataset but pulled from the National Data Buoy Center (NDBC). We thank the Rutgers OOI Data Lab for pointing out the direct data source in one of the data nuggets.

metbk_url = (
    "http://thredds.dataexplorer.oceanobservatories.org/thredds/dodsC/ooigoldcopy/public/"
    "CE04OSSM-SBD11-06-METBKA000-recovered_host-metbk_a_dcl_instrument_recovered/"
    "deployment0004_CE04OSSM-SBD11-06-METBKA000-recovered_host-metbk_a_dcl_instrument_recovered_20170421T022518.003000-20171013T154805.602000.nc#fillmismatch"
)
metbk_ds = (
    xr.open_dataset(metbk_url)
    .swap_dims({'obs': 'time'})
    .drop('obs')
    .sel(time=slice(start_datetime, end_datetime))[['shortwave_irradiance']]
)
metbk_ds.time.attrs.update({'long_name': 'Time', 'units': 'UTC'})

metbk_ds
<xarray.Dataset>
Dimensions:               (time: 1441)
Coordinates:
  * time                  (time) datetime64[ns] 2017-08-21T07:00:08.232999936...
Data variables:
    shortwave_irradiance  (time) float32 2.2 2.3 2.2 2.2 2.2 ... 2.4 2.3 2.3 2.4
Attributes: (12/73)
    node:                               SBD11
    comment:                            
    publisher_email:                    
    sourceUrl:                          http://oceanobservatories.org/
    collection_method:                  recovered_host
    stream:                             metbk_a_dcl_instrument_recovered
    ...                                 ...
    geospatial_vertical_positive:       down
    lat:                                44.36555
    lon:                                -124.9407
    DODS.strlen:                        14
    DODS.dimName:                       string14
    DODS_EXTRA.Unlimited_Dimension:     obs

3.5. Combine sonar observation with solar radiation measurements

We can finally put everything together and figure out the impact of the eclipse-driven reduction in sunlight on marine zooplankton!

metbk_plot = metbk_ds.hvplot.line(
    x='time', y='shortwave_irradiance'
).options(width=800, height=200, logy=True, xlim=(start_datetime, end_datetime))

mvbs_plot = ds_MVBS["Sv"].sel(frequency=200000).hvplot.image(
    x='ping_time', y='depth', 
    color='Sv', rasterize=True, 
    cmap='jet', clim=(-80, -30),
    xlabel='Time (UTC)',
    ylabel='Depth (m)'
).options(width=800, invert_yaxis=True, xlim=(start_datetime, end_datetime))
(metbk_plot + mvbs_plot).cols(1)

Look how the dip at solar radiation reading matches exactly with the upwarding moving “blip” at UTC 17:21, August 22, 2017 (local time 10:22 AM). During the solar eclipse, the animals were fooled by the temporary mask of the sun and thought it’s getting dark as at dusk!

3.6. Package versions

print(f"echopype: {ep.__version__}, xarray: {xr.__version__}, fsspec: {fsspec.__version__}, hvplot: {hvplot.__version__}")
echopype: 0.5.4, xarray: 0.19.0, fsspec: 2021.07.0, hvplot: 0.7.3
import datetime
print(f"{datetime.datetime.utcnow()} +00:00")
2021-10-28 03:08:13.301980 +00:00